package lab01;

import java.util.Scanner;

public class Test08 {
    public static void main(String[] args) {
        //取随机数
        int j = (int) (1 + Math.random() * 100);

        for(int i = 0;i <= 10;i ++){
        Scanner n = new Scanner(System.in);
            System.out.println("请输入你的猜测：");
            int num = n.nextInt();

        if (j > num) {
            System.out.println("猜小了");
        } else if (j < num) {
            System.out.println("猜大了");
        } else if (j == num) {
            System.out.println("猜中了");break;
        }}
    }
}
